﻿'Params
'mbid (Optional) : The musicbrainz id for the artist
'artist (Required (unless mbid)] : The artist name
'page (Optiona) : The page number to fetch. Defaults to first page.
'limit (Optional) : The number of results to fetch per page. Defaults to 50.
'autocorrect[0|1] (Optional) : Transform misspelled artist names into correct artist names, returning the correct version instead. The corrected artist name will be returned in the response.
'order (Optional) : Sort ordering can be either 'popularity' (default) or 'dateadded'. While ordering by popularity officially selected images by labels and artists will be ordered first. This is ignored and set to 'dateadded' when requested as rss.
'api_key (Required) : A Last.fm API key.
'Auth
'This service does not require authentication. 

Public Structure ArtistGetImagesResponse

End Structure

Public Class ArtistGetImages
    Inherits BaseRequest
    Dim mbid As String = ""
    Dim artist As String = ""
    Dim page As String = ""
    Dim limit As String = ""
    Dim autocorrect As String = ""
    Dim order As String = ""

    Public xmlresponse As XDocument = Nothing

    Public Sub New(mbid As String, artist As String, page As String, limit As String, autocorrect As String, order As String)
        Me.mbid = mbid
        Me.artist = artist
        Me.page = page
        Me.limit = limit
        Me.autocorrect = autocorrect
        Me.order = order
    End Sub

    Public Sub sendrequest()
        ClearMembers()

        AddMember("method", "artist.getImages")
        AddMember("artist", artist, String.IsNullOrEmpty(mbid))
        AddMember("page", page, False)
        AddMember("mbid", mbid, False)
        AddMember("autocorrect", autocorrect, False)
        AddMember("limit", limit, False)
        AddMember("api_key", My.Settings.api_key, False)

        xmlresponse = sendGETResponse(True)
    End Sub

    Public Function getResponse() As ArtistGetImagesResponse

        Return New ArtistGetImagesResponse

    End Function
End Class
